<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
'作者：山林客（ah_bill）
'博客：http://ruizhinet.blog.163.com
'网站：http://www.ruizhinet.cn
'本信息不会影响您网站的正常访问，请保留
checkadmin(4)
dim act
act=trim(request.QueryString("act"))
If act="" Then 
	Call SetSiteConfig()
End If 

Dim smtphost, smtpuser, smtppassword, smtpfromname, smtpmailto
Dim rs,sql
Set rs=server.CreateObject("adodb.recordset")
sql="select * from [c_smtp]"
rs.open sql,conn,1,1
If Not rs.eof Then 
smtphost=rs("smtphost")
smtpuser=rs("smtpuser")
smtppassword=rs("smtppassword")
smtpfromname=rs("smtpfromname")
smtpmailto=rs("smtpmailto")
End If 
rs.close
Set rs=Nothing 

If act="saveconfig" Then
	Call SaveConfig()
End If
If act="saveEmail" Then
	Call SaveEmail()
End If 
Sub SaveConfig()
	Dim x, rs, sql, val
	For Each x In Request.Form
		If x="rz_static" And request.Form(x)="0" And app("rz_static")=1 Then
			dim objFSO
			Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
			If Err.Number=-2147221005 Then 
				Response.Write "您的主机不支持FSO,请手工删除index.html文件"
				Err.Clear
				Response.End
			End If
			If objFSO.Fileexists(Server.Mappath(GetPath("index.html"))) Then
				objFSO.Deletefile(Server.Mappath(GetPath("index.html")))
			End If
			If objFSO.Fileexists(Server.Mappath(GetPath("index0.html"))) Then
				objFSO.Deletefile(Server.Mappath(GetPath("index0.html")))
			End If
			If objFSO.Fileexists(Server.Mappath(GetPath("index1.html"))) Then
				objFSO.Deletefile(Server.Mappath(GetPath("index1.html")))
			End If
			Set objFSO=Nothing 
		End If 

		Set rs=server.CreateObject("adodb.recordset")
		sql="select * from [c_settings] where var_name='"&x&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then 
		rs("var_value")=HTMLEncode(request.Form(x))
		Else
		rs.addnew
		rs("var_name")=x
		rs("var_value")=HTMLEncode(request.Form(x))
		End If 
		rs.update
		rs.close
		Set rs=Nothing 
	Next
		Call SetSiteConfig()
		response.redirect("showmsg.asp?from=settings.asp&msg=ModifySuccess")
End Sub


Sub SaveEmail()
Dim rs,sql
Set rs=server.CreateObject("adodb.recordset")
sql="select * from [c_smtp]"
rs.open sql,conn,1,3
If Not rs.eof Then 
rs("smtphost")=Trim(request.form("smtphost"))
rs("smtpuser")=Trim(request.form("smtpuser"))
rs("smtppassword")=Trim(request.Form("smtppassword"))
rs("smtpfromname")=Trim(request.Form("smtpfromname"))
rs("smtpmailto")=Trim(request.Form("smtpmailto"))
rs.update
End If 
rs.close
Set rs=Nothing 
response.redirect("showmsg.asp?from=settings.asp&msg=ModifySuccess")
End Sub

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站基本配置</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
<script type="text/javascript" src="admin_js/common.js"></script>
</head>
<body>
<form method="post" name="rzform" action="?act=saveconfig">
<table class="table_800" cellspacing="0" cellpadding="0">
<tr>
	<th colspan="2">网站信息配置</th>
</tr>
<tr  class="row">
	<td>网站名称</td>
	<td><input type="text" id="rz_title_chn" name="rz_title_chn" size="30" value="<%=app("rz_title_chn")%>"/><span class="redstar">*</span></td>
</tr>
<tr  class="row">
	<td>网站地址</td>
	<td><input type="text" id="rz_website_address" name="rz_website_address" size="30" value="<%=app("rz_website_address")%>"/><span class="redstar">*</span>后面不带“/”<br/>例如：http://www.ruizhinet.cn</td>
</tr>
<tr  class="row">
	<td>WebSite Title</td>
	<td><input type="text" id="rz_title_eng" name="rz_title_eng" size="30" value="<%=app("rz_title_eng")%>"/><span class="redstar">*</span></td>
</tr>
<tr  class="row">
	<td>网站关键字</td>
	<td><textarea id="rz_keyword_chn" name="rz_keyword_chn" rows="3" cols="40"><%=app("rz_keyword_chn")%></textarea>（填写本栏有利于搜索引擎收录，关键字之间请用,分开）</td>
</tr>
<tr  class="row">
	<td>WebSite Keyword</td>
	<td><textarea id="rz_keyword_eng" name="rz_keyword_eng" rows="3" cols="40"><%=app("rz_keyword_eng")%></textarea>（填写本栏有利于搜索引擎收录，关键字之间请用,分开）</td>
</tr>
<tr  class="row">
	<td>网站描述</td>
	<td><textarea id="rz_description_chn" name="rz_description_chn" rows="3" cols="40"><%=app("rz_description_chn")%></textarea>（填写本栏有利于搜索引擎收录）</td>
</tr>
<tr  class="row">
	<td>WebSite Description</td>
	<td><textarea id="rz_description_eng" name="rz_description_eng" rows="3" cols="40"><%=app("rz_description_eng")%></textarea>（填写本栏有利于搜索引擎收录）</td>
</tr>
<tr  class="row">
	<td>ICP备案号</td>
	<td><input type="text" id="rz_beian" name="rz_beian" size="30" value="<%=app("rz_beian")%>"/></td>
</tr>
<tr  class="row">
	<td>计数器代码</td>
	<td><textarea id="rz_counter" name="rz_counter" rows="3" cols="40"><%=ReHTMLEncode(app("rz_counter"))%></textarea>建议使用CNZZ计数器&nbsp;<a href="http://www.cnzz.com/" target="_blank">申请</a></td>
</tr>
<tr  class="row">
	<td>网站模板</td>
	<td>
	<select name="rz_template_chn">
		<%Call ShowTemplateOption(app("rz_template_chn"))%>
	</select>请将模板放置在template目录下
	</td>
</tr>
<tr  class="row">
	<td>WebSite Template</td>
	<td>
	<select name="rz_template_eng">
		<%Call ShowTemplateOption(app("rz_template_eng"))%>
	</select>请将模板放置在template目录下
	</td>
</tr>
<tr  class="row">
	<td>网站语言</td>
	<td>
	<select name="rz_language">
		<option value="1" <%If app("rz_language")=1 Then response.write("selected=""true""") End If%>>纯中文</option>
		<option value="2" <%If app("rz_language")=2 Then response.write("selected=""true""") End If%>>中文+英文</option>
	</select>
	</td>
</tr>
<tr  class="row">
	<td>默认语言</td>
	<td>
	<select name="rz_defaultlanguage">
		<option value="0" <%If app("rz_defaultlanguage")=0 Then response.write("selected=""true""") End If%>>中文</option>
		<option value="1" <%If app("rz_defaultlanguage")=1 Then response.write("selected=""true""") End If%>>英文</option>
	</select>
	</td>
</tr>
<tr  class="row">
	<td>管理员Email</td>
	<td><input type="text" id="rz_adminemail" name="rz_adminemail" size="20" value="<%=app("rz_adminemail")%>"/></td>
</tr>
 <tr  class="row">
	<td>专题列表每页记录数</td>
	<td><input type="text" id="rz_perpage_speciallist" name="rz_perpage_speciallist" size="5" value="<%=app("rz_perpage_speciallist")%>" onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')"/><span class="redstar">*</span>指专题列表页面每页显示多少个专题，rzlist标签中请使用pagesize=&quot;[app.rz_perpage_speciallist]&quot;来设置该值</td>
</tr>
<tr  class="row">
	<td>网站状态</td>
	<td>
	<input type="radio" name="rz_state" value="1" <%If app("rz_state")=1 Then response.write("checked") End If%>/>开放&nbsp;&nbsp;<input type="radio" name="rz_state" value="0" <%If app("rz_state")=0 Then response.write("checked") End If%>/>关闭
	</td>
</tr>
<tr  class="row">
	<td>使用静态化</td>
	<td><input type="radio" name="rz_static" value="1" <%If app("rz_static")=1 Then response.write("checked") End If%>/>使用&nbsp;&nbsp;<input type="radio" name="rz_static" value="0" <%If app("rz_static")=0 Then response.write("checked") End If%>/>不使用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（建议使用）
	</td>
</tr>
<tr>
	<th colspan="2">公司信息配置</th>
</tr>
<tr  class="row">
	<td>公司名称</td>
	<td><input type="text" id="rz_company_name_chn" name="rz_company_name_chn" size="30" value="<%=app("rz_company_name_chn")%>"/></td>
</tr>
<tr  class="row">
	<td>Company Name</td>
	<td><input type="text" id="rz_company_name_eng" name="rz_company_name_eng" size="30" value="<%=app("rz_company_name_eng")%>"/></td>
</tr>
<tr  class="row">
	<td>公司地址</td>
	<td><input type="text" id="rz_company_addr_chn" name="rz_company_addr_chn" size="40" value="<%=app("rz_company_addr_chn")%>"/></td>
</tr>
<tr  class="row">
	<td>Company Address</td>
	<td><input type="text" id="rz_company_addr_eng" name="rz_company_addr_eng" size="40" value="<%=app("rz_company_addr_eng")%>"/></td>
</tr>
<tr  class="row">
	<td>公司邮编</td>
	<td><input type="text" id="rz_company_zipcode" name="rz_company_zipcode" size="20" value="<%=app("rz_company_zipcode")%>"/></td>
</tr>
<tr  class="row">
	<td>公司电话</td>
	<td><input type="text" id="rz_company_tel" name="rz_company_tel" size="30" value="<%=app("rz_company_tel")%>"/></td>
</tr>
<tr  class="row">
	<td>公司传真</td>
	<td><input type="text" id="rz_company_fax" name="rz_company_fax" size="30" value="<%=app("rz_company_fax")%>"/></td>
</tr>
<tr  class="row">
	<td>公司Email</td>
	<td><input type="text" id="rz_company_email" name="rz_company_email" size="30" value="<%=app("rz_company_email")%>"/>多个Email之间以|分隔</td>
</tr>
<tr  class="row">
	<td>公司MSN</td>
	<td><input type="text" id="rz_company_msn" name="rz_company_msn" size="30" value="<%=app("rz_company_msn")%>"/>多个MSN之间以|分隔</td>
</tr>
<tr  class="row">
	<td>公司QQ</td>
	<td><input type="text" id="rz_company_qq" name="rz_company_qq" size="30" value="<%=app("rz_company_qq")%>"/>多个MSN之间以|分隔</td>
</tr>
<tr>
	<th colspan="2">SQL防注入功能及其他功能配置</th>
</tr>
<tr  class="row">
	<td>要过滤的关键字</td>
	<td><input type="text" id="rz_inj_keywords" name="rz_inj_keywords" size="30" value="<%=app("rz_inj_keywords")%>"/>关键字之间以|分隔</td>
</tr>
<tr  class="row">
	<td>是否记录入侵者信息</td>
	<td>
	<input type="radio" name="rz_inj_recordInfo" value="1" <%If app("rz_inj_recordInfo")=1 Then response.write("checked") End If%>/>是&nbsp;&nbsp;<input type="radio" name="rz_inj_recordInfo" value="0" <%If app("rz_inj_recordInfo")=0 Then response.write("checked") End If%>/>否
	</td>
</tr>
<tr  class="row">
	<td>是否启用IP锁定功能</td>
	<td>
	<input type="radio" name="rz_inj_lockIP" value="1" <%If app("rz_inj_lockIP")=1 Then response.write("checked") End If%>/>是&nbsp;&nbsp;<input type="radio" name="rz_inj_lockIP" value="0" <%If app("rz_inj_lockIP")=0 Then response.write("checked") End If%>/>否
	</td>
</tr>
<tr  class="row">
	<td>是否启用安全页面功能</td>
	<td>
	<input type="radio" name="rz_inj_openSafePage" value="1" <%If app("rz_inj_openSafePage")=1 Then response.write("checked") End If%>/>是&nbsp;&nbsp;<input type="radio" name="rz_inj_openSafePage" value="0" <%If app("rz_inj_openSafePage")=0 Then response.write("checked") End If%>/>否
	</td>
</tr>
<tr  class="row">
	<td>安全页面</td>
	<td><input type="text" id="rz_inj_theSafePages" name="rz_inj_theSafePages" size="30" value="<%=app("rz_inj_theSafePages")%>"/>以|分隔</td>
</tr>
<tr  class="row">
	<td>出错后的处理</td>
	<td>
	<select name="rz_inj_stopType">
          <option value="1" <%if app("rz_inj_stopType")=1 Then response.write "selected=true"%>>直接关闭网页</option>
          <option value="2" <%if app("rz_inj_stopType")=2 Then response.write "selected=true"%>>警告后关闭</option>
		  <option value="3" <%if app("rz_inj_stopType")=3 Then response.write "selected=true"%>>跳转到指定页面</option>
		  <option value="4" <%if app("rz_inj_stopType")=4 Then response.write "selected=true"%>>警告后跳转</option>
    </select>
	</td>
</tr>
<tr  class="row">
	<td>出错后跳转URL</td>
	<td><input type="text" id="rz_inj_alertURL" name="rz_inj_alertURL" size="30" value="<%=app("rz_inj_alertURL")%>"/></td>
</tr>
<tr  class="row">
	<td>出错提示信息</td>
	<td><input type="text" id="rz_inj_alertInformation" name="rz_inj_alertInformation" size="30" value="<%=app("rz_inj_alertInformation")%>"/>\n\n换行</td>
</tr>
<tr  class="row">
	<td>阻止访问提示信息</td>
	<td><input type="text" id="rz_inj_stopInformation" name="rz_inj_stopInformation" size="30" value="<%=app("rz_inj_stopInformation")%>"/>\n\n换行</td>
</tr>
<tr  class="row">
	<td>页面刷新时间</td>
	<td>
	<select name="rz_refreshtime" id="rz_refreshtime">
          <option value="0" <%if app("rz_refreshtime")=0 Then response.write "selected=true"%>>禁用</option>
          <option value="1" <%if app("rz_refreshtime")=1 Then response.write "selected=true"%>>1秒</option>
		  <option value="2" <%if app("rz_refreshtime")=2 Then response.write "selected=true"%>>2秒</option>
		  <option value="3" <%if app("rz_refreshtime")=3 Then response.write "selected=true"%>>3秒</option>
		  <option value="4" <%if app("rz_refreshtime")=4 Then response.write "selected=true"%>>4秒</option>
		  <option value="5" <%if app("rz_refreshtime")=5 Then response.write "selected=true"%>>5秒</option>
    </select>
	</td>
</tr>
<tr  class="row">
	<td>发布留言审核</td>
	<td>
	<input type="radio" name="rz_guestbookaudit" value="1" <%If app("rz_guestbookaudit")=1 Then response.write("checked") End If%>/>启用审核&nbsp;&nbsp;<input type="radio" name="rz_guestbookaudit" value="0" <%If app("rz_guestbookaudit")=0 Then response.write("checked") End If%>/>不需审核
	</td>
</tr>
<tr  class="row">
	<td>发布评论审核</td>
	<td>
	<input type="radio" name="rz_commentaudit" value="1" <%If app("rz_commentaudit")=1 Then response.write("checked") End If%>/>启用审核&nbsp;&nbsp;<input type="radio" name="rz_commentaudit" value="0" <%If app("rz_commentaudit")=0 Then response.write("checked") End If%>/>不需审核
	</td>
</tr>
<tr  class="row">
	<td>记录管理日志</td>
	<td>
	<input type="radio" name="rz_savelog" value="1" <%If app("rz_savelog")=1 Then response.write("checked") End If%>/>保存&nbsp;&nbsp;<input type="radio" name="rz_savelog" value="0" <%If app("rz_savelog")=0 Then response.write("checked") End If%>/>不保存&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（建议保存）
	</td>
</tr>
<tr  class="row">
	<td>新留言邮件通知</td>
	<td>
	<input type="radio" name="rz_sendmail_guestbook" value="1" <%If app("rz_sendmail_guestbook")=1 Then response.write("checked") End If%>/>启用&nbsp;&nbsp;<input type="radio" name="rz_sendmail_guestbook" value="0" <%If app("rz_sendmail_guestbook")=0 Then response.write("checked") End If%>/>关闭&nbsp;&nbsp;<%If  Not IsObjInstalled("JMail.Message") Then%><span style='color:red'>（服务器不支持Jmail，不能使用此功能）</span><%else%>（需配置下面的“邮箱信息配置”）<%End If%>
	</td>
</tr>
<tr  class="row">
	<td>新评论邮件通知</td>
	<td>
	<input type="radio" name="rz_sendmail_comment" value="1" <%If app("rz_sendmail_comment")=1 Then response.write("checked") End If%>/>启用&nbsp;&nbsp;<input type="radio" name="rz_sendmail_comment" value="0" <%If app("rz_sendmail_comment")=0 Then response.write("checked") End If%>/>关闭&nbsp;&nbsp;<%If Not IsObjInstalled("JMail.Message") Then%><span style='color:red'>（服务器不支持Jmail，不能使用此功能）</span><%else%>（需配置下面的“邮箱信息配置”）<%End If%>
	</td>
</tr>
<tr  class="row">
	<td colspan="2" class="tdcenter"><input type="button" class="btn" onclick="checkForm('website');" value="保存"/>&nbsp;&nbsp;&nbsp;<input class="btn" type="reset" value="重置"/></td>
</tr>
</table>
 </form>
<br/>
<div style="width:300px;margin:0px auto;color:red;font-weight:bold;">提醒：这里有两个保存，不要搞错了哦！！</div>
<br/>
<form method="post" id="emailform" name="emailform" action="?act=saveEmail">
<table class="table_800" cellspacing="0" cellpadding="0">
<tr>
	<th colspan="2">邮箱信息配置</th>
</tr>
<tr  class="row">
	<td>SMTP服务器</td>
	<td><input type="text" id="smtphost" name="smtphost" size="30" value="<%=smtphost%>"/><span class="redstar">*</span>例如：smtp.qq.com</td>
</tr>
<tr  class="row">
	<td>邮箱登陆账号</td>
	<td><input type="text" id="smtpuser" name="smtpuser" size="30" value="<%=smtpuser%>"/><span class="redstar">*</span>例如：abc@qq.com</td>
</tr>
<tr  class="row">
	<td>邮箱登陆密码</td>
	<td><input type="password" id="smtppassword" name="smtppassword" size="30" value="<%=smtppassword%>"/><span class="redstar">*</span></td>
</tr>
<tr  class="row">
	<td>发送方名称</td>
	<td><input type="text" id="smtpfromname" name="smtpfromname" size="30" value="<%=smtpfromname%>"/><span class="redstar">*</span>例如：瑞志邮件信使</td>
</tr>
<tr  class="row">
	<td>接收通知邮箱</td>
	<td><input type="text" id="smtpmailto" name="smtpmailto" size="30" value="<%=smtpmailto%>"/><span class="redstar">*</span>例如：tom@qq.com|jack@qq.com，多个邮箱地址之间用“|”分隔<br/>建议不要多于3个，否则可能导致发送方邮箱被服务商禁用。如果您想其他邮箱也能收到通知，建议使用一个邮箱接收通知，然后再利用该邮箱的自动转发功能将邮件转发到其他邮箱。</td>
</tr>
<tr  class="row">
	<td >注意</td>
	<td>本功能基于Jmail来发送，需要满足以下两个条件：1.服务器支持Jmail组件；2.发送邮箱支持Jmail中转。目前大多数免费邮箱为了防止垃圾邮件都屏蔽了此功能，截至本程序开发的时候，QQ免费邮箱仍支持此功能（需启用SMTP），而企业邮局或收费邮箱则大多数都支持此项功能。</td>
</tr>
<tr  class="row">
	<td colspan="2" class="tdcenter"><input type="button" class="btn" onclick="checkform_email();" value="保存"/>&nbsp;&nbsp;&nbsp;<input class="btn" type="reset" value="重置"/></td>
</tr>
</table>
</form>
</body>
</html>